1. Field of the Invention
Embodiments of the present invention generally relate to computer networks that share resources amongst applications and, more particularly, to a method and apparatus for sharing a resource lock amongst applications.
2. Description of the Related Art
A significant advantage of computer networks is that a user can remotely access a document, an image, a printer, backup storage, or other resources. Computer networks, and the Internet, in particular, have rendered the geographic location of a user irrelevant. The Internet contains a vast number of resources that are available to practically anyone with an Internet connection. In a similar manner, local area networks can make documents, applications, printers, and other resources available to anyone connected to the local area network.
This ability to remotely access a resource has greatly enhanced the ability of people and businesses to work together more quickly and efficiently. This is especially true of a remote resource that is collaboratively produced or otherwise utilized.
Additionally, individual nodes of a network may simultaneously execute multiple software applications that access and utilize resources with the network or within the computer executing the applications. The speed of computers enables such simultaneous execution of applications. As such, individual nodes and multiple nodes of a network may execute applications that utilize the same resources.
When multiple applications of a network (whether executing on a single node or multiple nodes) need to utilize a resource at the same time, a collision or deadlock may occur. Consequently, applications are designed to utilize locks to block multiple applications from simultaneously attempting to use a resource, i.e., access to a resource is serialized. Locks generally come in two types: exclusive and shared. An exclusive lock, when used by an application running on a particular node, blocks all other applications from accessing the resource during the period that the lock is enabled. A shared lock permits an application to access a resource, but allows other applications executing on the same or other nodes to also have unlimited access to the resource. The other applications that may access the resource are only limited by the security features of the network.
A shared lock may also be “color coded” where the shared lock is assigned a color and applications that have been assigned the same color may utilize the same colored locked. Thus, the locks are only granted to applications having the same color.
Serialization using exclusive locks for individual applications might result in an inefficient use of resources. In some instances, a number of applications may simultaneously utilize a resource without conflict; however, the underlying assumption of exclusive lock techniques is that simultaneous use of a resource is to be avoided. On the other hand, shared locks are too liberal in their allowance of applications to simultaneously use a resource. Shared locks invite conflicts by allowing open access to resources.
It would be beneficial if groups of compatible applications could be provided exclusive access to a resource, while applications that do not belong to the group, i.e., applications that may cause conflicts, are blocked from such access for a period of time while the lock is enabled.